GBML manual / Save

save_remove

Takes ONE saved key out, so save_has(key) is false afterwards and save_get gives your default again. save_clear empties everything; this forgets just the one thing, such as a high score you want to reset or a flag for a door that should be shut again. A key that was never saved is left alone.

Syntax

save_remove(key)

Arguments

NameType
keystring

Returns

Nothing.

Description

Takes one saved key out, so save_has is false for it afterwards and save_get gives your default again. save_clear empties everything; save_remove forgets just the one thing, such as a high score you want to reset or a flag for a door that should be shut again.

Example

save_set("best_time", 120);
save_remove("best_time");
var gone = save_has("best_time");

gone is false: the key is no longer saved.

The small print

Cost

One search through the saved keys.

On the GBA

Like save_set it changes the working copy in memory only: call save_commit afterwards to make the removal survive a power cycle. The freed place can be used by a different key later (the store holds a limited number of keys). Nothing else is touched - the rooms' remembered collision layers stay as they are, which save_clear would reset. A game that never calls save_remove does not carry the code for it.

See also: save_clearsave_setsave_hassave_commit